package com.hjxr.xmgl.web.service.impl;

import java.util.List;
import com.hjxr.common.utils.DateUtils;
import com.hjxr.xmgl.web.domain.EvnetHistory;
import com.hjxr.xmgl.web.mapper.EvnetHistoryMapper;
import com.hjxr.xmgl.web.service.IEvnetHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 事件执行记录Service业务层处理
 *
 * @author hjxr
 * @date 2021-12-02
 */
@Service
public class EvnetHistoryServiceImpl implements IEvnetHistoryService
{
    @Autowired
    private EvnetHistoryMapper evnetHistoryMapper;

    /**
     * 查询事件执行记录
     *
     * @param id 事件执行记录ID
     * @return 事件执行记录
     */
    @Override
    public EvnetHistory selectEvnetHistoryById(Long id)
    {
        return evnetHistoryMapper.selectEvnetHistoryById(id);
    }

    /**
     * 查询事件执行记录列表
     *
     * @param evnetHistory 事件执行记录
     * @return 事件执行记录
     */
    @Override
    public List<EvnetHistory> selectEvnetHistoryList(EvnetHistory evnetHistory)
    {
        return evnetHistoryMapper.selectEvnetHistoryList(evnetHistory);
    }

    /**
     * 新增事件执行记录
     *
     * @param evnetHistory 事件执行记录
     * @return 结果
     */
    @Override
    public int insertEvnetHistory(EvnetHistory evnetHistory)
    {
        evnetHistory.setCreateTime(DateUtils.getNowDate());
        return evnetHistoryMapper.insertEvnetHistory(evnetHistory);
    }

    /**
     * 修改事件执行记录
     *
     * @param evnetHistory 事件执行记录
     * @return 结果
     */
    @Override
    public int updateEvnetHistory(EvnetHistory evnetHistory)
    {
        return evnetHistoryMapper.updateEvnetHistory(evnetHistory);
    }

    /**
     * 批量删除事件执行记录
     *
     * @param ids 需要删除的事件执行记录ID
     * @return 结果
     */
    @Override
    public int deleteEvnetHistoryByIds(Long[] ids)
    {
        return evnetHistoryMapper.deleteEvnetHistoryByIds(ids);
    }

    /**
     * 删除事件执行记录信息
     *
     * @param id 事件执行记录ID
     * @return 结果
     */
    @Override
    public int deleteEvnetHistoryById(Long id)
    {
        return evnetHistoryMapper.deleteEvnetHistoryById(id);
    }
}
